package com.bjpowernode.validator.controller;

import com.bjpowernode.validator.pojo.Employee;
import com.bjpowernode.validator.vo.ResultVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.groups.Default;

/**
 * ClassName:EmployeeController
 * Package:com.bjpowernode.validator.controller
 * Description: 描述信息
 *
 * @date:2022/3/19 14:40
 * @author:动力节点
 */
@RestController
@Validated
@RequestMapping("/employee")
public class EmployeeController {

    @PostMapping
    public ResultVO add(@RequestBody @Validated({Employee.Add.class, Default.class}) Employee employee){
        return ResultVO.success();
    }

    @PostMapping
    public ResultVO update(@RequestBody @Validated({Employee.Update.class, Default.class}) Employee employee){
        return ResultVO.success();
    }
}
